package net.entelijan.cobean.core.impl;

import java.util.List;

import net.entelijan.cobean.core.ISingleSelectionListCobean;

public abstract class AbstractBoundPropertySingleSelectionComponentBean<T>
		extends AbstractComponentBean implements
		ISingleSelectionListCobean<T> {

	public AbstractBoundPropertySingleSelectionComponentBean() {
		super();
	}

	@Override
	public void setValue(List<T> value) {
		List<T> oldValue = getValue();
		setValuePlain(value);
		propertyChangeSupport.firePropertyChange("value", oldValue, value);
	}

	protected abstract void setValuePlain(List<T> value);

	@Override
	public void setSelectedValue(T value) {
		T oldValue = getSelectedValue();
		setSelectedValuePlain(value);
		propertyChangeSupport
				.firePropertyChange("selectedValue", oldValue, value);
	}

	protected abstract void setSelectedValuePlain(T selectedValue);

}
